﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Meqs.Entity;
using Meqs.Logic.Interface;
using System.Collections.Generic;

public partial class School_Left : System.Web.UI.Page
{
    public int examId = 0;
    
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        { 
            repeatReport.DataSource = GetReportInfo();
            repeatReport.DataBind();
        }
    }



    private List<ReporTtypeEducation> GetReportInfo()
    {
        List<ReporTtypeEducation> list = new List<ReporTtypeEducation>();
        int examId = 0, examType = 0,grade = 0;
        string s = "";

        examType = SchoolCookie.ExamType;
        examId = SchoolCookie.ExamID;
        grade = SchoolCookie.ExamGrade;

        string type = "";
        ReporTtypeEducation exam = new ReporTtypeEducation();
        if (examType == 0)
        {
            exam.ReportName = "班级成绩明细查询";
            exam.Keyword = "CLASSDITAIL";
            list.Add(exam);
            exam = new ReporTtypeEducation();
            exam.ReportName = "考生成绩查询";
            exam.Keyword = "STUDENTSCORE";
            list.Add(exam);
            exam = new ReporTtypeEducation();
            exam.ReportName = "考生排名查询";
            exam.Keyword = "STUDENTPOSITION";
            list.Add(exam);
            string[] arr = Reports.GetExamName(0, grade);
            string[] arrKey = Reports.GetExamTypes(0, grade);
            int i = 0;
            foreach (string item in arr)
            {
                exam = new ReporTtypeEducation();
                exam.ReportName = item;
                exam.Keyword = arrKey[i];
                if (exam.Keyword != "SCOREPOINTSET")
                    list.Add(exam);
                i++;
            }
            //暂时先去掉教师报表
            //exam = new ReporTtypeEducation();
            //exam.ReportName = "教师带班成绩查询";
            //exam.Keyword = "TEACHCLASS";
            //list.Add(exam);
           
        }
        else
        {
            string[] arr = Reports.GetExamName(0, grade);
            string[] arrKey = Reports.GetExamTypes(0, grade);
            int i = 0;
            exam.ReportName = "班级成绩明细查询";
            exam.Keyword = "CLASSDITAIL";
            list.Add(exam);

            exam = new ReporTtypeEducation();
            exam.ReportName = "考生成绩查询";
            exam.Keyword = "STUDENTSCORE";
            list.Add(exam);
            exam = new ReporTtypeEducation();
            exam.ReportName = "考生排名查询";
            exam.Keyword = "STUDENTPOSITION";
            list.Add(exam);

            foreach (string item in arr)
            {
                exam = new ReporTtypeEducation();
                exam.ReportName = item;
                exam.Keyword = arrKey[i];
                list.Add(exam);
                i++;
            }
            //暂时先去掉教师报表
            //exam = new ReporTtypeEducation();
            //exam.ReportName = "教师带班成绩查询";
            //exam.Keyword = "TEACHCLASS";
            //list.Add(exam);
        }
        return list;
    }

    /// <summary>
    /// 获取左导航路径
    /// </summary>
    /// <param name="reportName"></param>
    /// <returns></returns>
    public string GetHerf(string reportName)
    {
        int examType = -1;
        string s = "";

        examType = SchoolCookie.ExamType;

        s = "";
        if(examType == 0)//校级
        {
            if (reportName.Trim().Equals("CLASSDITAIL"))
                s = "Report/ClassSchoolReport.aspx";
            if (reportName.Trim().Equals("KINDSET"))
                s = "Report/KindSchoolReport.aspx";
            if (reportName.Trim().Equals("SECTIONSET"))
                s = "Report/SectionSchoolReport.aspx";
            if (reportName.Trim().Equals("DISTRIBUTION"))
                s = "Report/DistributionSchoolReport.aspx";
            if (reportName.Trim().Equals("SCOREPOINTSET"))
                s = "Report/ScorePointSchoolReport.aspx";
            if (reportName.Trim().Equals("TEACHCLASS"))
                s = "Report/TeacherSchoolReport.aspx";
            if (reportName.Trim().Equals("STUDENTSCORE"))
                s = "Report/SelectScoreSchool.aspx";
            if (reportName.Trim().Equals("STUDENTPOSITION"))
                s = "Report/SelectPositionSchool.aspx";
        }
        else//局级
        {
            if (reportName.Trim().Equals("CLASSDITAIL"))
                s = "Report/ClassSchoolReport.aspx";
            if (reportName.Trim().Equals("KINDSET"))
                s = "Report/KindEduReport.aspx";
            if (reportName.Trim().Equals("SECTIONSET"))
                s = "Report/SectionEduReport.aspx";
            if (reportName.Trim().Equals("DISTRIBUTION"))
                s = "Report/DistributionEduReport.aspx";
            if (reportName.Trim().Equals("SCOREPOINTSET"))
                s = "Report/ScorePointEduReport.aspx";
            if (reportName.Trim().Equals("TEACHCLASS"))
                s = "Report/TeacherSchoolReport.aspx";
            if (reportName.Trim().Equals("STUDENTSCORE"))
                s = "Report/SelectScoreEducation.aspx";
            if (reportName.Trim().Equals("STUDENTPOSITION"))
                s = "Report/SelectPositionEducation.aspx";
        }
        return s;
    }
}
